{extend name="base"}
{block name="title"}在线支付{/block}
{block name="head"}
<script>
$(function () {
  $('button').click(function () {
    var r = confirm("您确认补发佣金?");
    if (r) {
      var bill = $(this).data('bill');
      $.post("{:url('user.pay/reissue')}?MerBillNo=" + bill, function (data) {
        alert(data.error);
        if (data.errno == 0) {
          location.reload();
        }
      });
    }
    return false;
  });
});
</script>
{/block}
{block name="body"}
<body class="mainbody">
<form>
  <!--导航栏-->
  <div class="location">
    <a href="javascript:history.back(-1);" class="back"><i class="iconfont icon-up"></i><span>返回上一页</span></a>
    <a href="{:url('index/home')}" class="home"><i class="iconfont icon-home"></i><span>首页</span></a>
    <i class="arrow iconfont icon-arrow-right"></i>
    <span>在线支付</span>
  </div>
  <!--/导航栏-->

  <!--工具栏-->
  <div id="floatHead" class="toolbar-wrap">
    <div class="toolbar">
      <div class="box-wrap">
        <a class="menu-btn"><i class="iconfont icon-more"></i></a>
        <div class="l-list">
          <div class="menu-list">
            <div class="rule-single-select">
              <select name="Channel" style="display:none">
                <option value="-1">===所有渠道===</option>
                {volist name="CHANNELS" id="val"}
                <option value="{$key}"{eq name="Channel" value="$key"} selected{/eq}>[{$key}]{$val.Name}</option>
                {/volist}
              </select>
            </div>
            <div class="rule-single-select">
              <select name="KindID" style="display:none">
                <option value="-1">===所有游戏===</option>
                {volist name="GAME_KIND" id="v"}
                <option value="{$key}"{eq name="KindID" value="$key"} selected{/eq}>[{$key}]{$v}</option>
                {/volist}
              </select>
            </div>
            <input type="text" class="input rule-date-input" id="time1" autocomplete="off" {literal}onclick="WdatePicker({maxDate:'#F{$dp.$D(\'time2\')}'})"{/literal} name="time1" value="{$time1<=0?'':date('Y-m-d',$time1)}" placeholder="订单起始日期" /> -
            <input type="text" class="input rule-date-input" id="time2" autocomplete="off" {literal}onclick="WdatePicker({minDate:'#F{$dp.$D(\'time1\')}', maxDate:'%y-%M-%d'})"{/literal} name="time2" value="{$time2<=0?'':date('Y-m-d',$time2)}" placeholder="订单结束日期" />
            <div class="rule-single-select">
              <select name="ptype" id="txtFieldType" style="display:none">
                {volist name="PAY_TYPES" id="val"}
                <option value="{$key}"{eq name="ptype" value="$key"} selected{/eq}>{$val}</option>
                {/volist}
              </select>
            </div>
            <div class="rule-single-select">
              <select name="state1" style="display:none">
                <option value="-1">订单状态</option>
                {volist name="STATE_PAY" id="val"}
                <option value="{$key}"{eq name="state1" value="$key"} selected{/eq}>[{$key}]{$val}</option>
                {/volist}
              </select>
            </div>
            <div class="rule-single-select">
              <select name="state2" style="display:none">
                <option value="-1">发货状态</option>
                {volist name="STATE_ORD" id="val"}
                <option value="{$key}"{eq name="state2" value="$key"} selected{/eq}>[{$key}]{$val}</option>
                {/volist}
              </select>
            </div>
            <input type="text" class="input" autocomplete="off" name="search" value="{$search|default=''|htmlentities}" placeholder="GameID/昵称/订单号" />
            <a class="btn-search"><i class="iconfont icon-search"></i></a>
          </div>
        </div>
        <div class="r-list">
          <label style="color:#f00;">合计：{$total|default=0}</label>
        </div>
      </div>
    </div>
  </div>
  <!--/工具栏-->

  <!--列表-->
  <div class="table-container">
    <table class="ltable border-table">
      <tr>
        <th>#</th>
        <th>所属渠道</th>
        <th>充值游戏</th>
        <th>充值用户</th>
        <th>所属代理</th>
        <th>内部订单号</th>
        <th>充值金额</th>
        <th>充值类型</th>
        <th>订单状态</th>
        <th>发货状态</th>
        <th>充值域名/充值IP</th>
        <th>下单时间/到账时间</th>
        <th>佣金验证</th>
      </tr>
{empty name="list"}
      <tr><td colspan="12">Oh~暂无数据!</td></tr>
{else}
      {volist name="list" id="v"}
      <tr>
        <td>{$v.ID}</td>
        <td>{$CHANNELS[$v.Channel]['Name'] ?? '--'}</td>
        <td>{$v.GameName ?? '--'}</td>
        <td class="user-avatar" title="
游戏帐号：{$v.Accounts}&#13
用户标识：{$v.UserID}&#13
游戏标识：{$v.GameID}&#13
真实姓名：{$v.Compellation}&#13
身份证号：{$v.PassPortID}&#13
手机号码：{$v.RegisterMobile}&#13
    性别：{switch name='$v.Sex'}{case value='0'}未知{/case}{case value='1'}男性{/case}{case value='2'}女性{/case}{/switch}&#13
注册时间：{$v.RegisterDate}&#13
注册地址：{$v.RegisterIP}&#13;
登录次数：{$v.GameLogonCount} 次&#13
最后登录时间：{$v.LastLogonDate}&#13
最后登录地址：{$v.LastLogonIP}&#13
">
          <a target="_blank" href="{:url('user.detail/index')}?UserID={$v.UserID}">
            <img src="{$v.Avatar?:'__STATIC__/houtai/images/dface.png'}" />
          </a>
          <div class="user-box">
            <h4><a target="_blank" class="at_{$v.AccountsType}" href="{:url('user.detail/index')}?UserID={$v.UserID}">{:htmlentities($v.NickName)}</a></h4>
            <i>{$v.GameID}</i>
          </div>
        </td>
        <td class="user-avatar">
          <a target="_blank" href="{:url('user.detail/index')}?UserID={$v.AUserID}">
            <img src="{$v.AAvatar?:'__STATIC__/houtai/images/dface.png'}" />
          </a>
          <div class="user-box">
            <h4><a target="_blank" class="at_{$v.AAccountsType}" href="{:url('user.detail/index')}?UserID={$v.AUserID}">{$v.ACompellation}</a></h4>
            <i>{$v.AGameID}</i>
          </div>
        </td>
        <td>
          <a target="_blank" href="{:url('user.pay/rebate')}?search={$v.MerBillNo}">{$v.MerBillNo}<br/>{$v.TradeNo}</a><br/>
        </td>
        <td>{$v.RMB}</td>
        <td>{$v.PayType}</td>
        <td class="sp_{$v.Status}">[{$v.Status}]{$STATE_PAY[$v.Status] ?? '--'}</td>
        <td class="sp_{$v.GameStatus}">[{$v.GameStatus}]{$STATE_ORD[$v.GameStatus] ?? '--'}</td>
        <td>{$v.wwwType}<br/><a target="_blank" href="http://www.baidu.com/s?wd={$v.wwwIp}">{$v.wwwIp}</a></td>
        <td>{$v.AddTime?:'--'}<br/>{$v.UpdateTime?:'--'}</td>
        <td>
        {if condition="($v.fc>0 AND $v.AUserID>0) OR ($v.fc==0 AND $v.AUserID==0)"}
          <font color="green">正常({$v.fc})</font>
        {else/}
          <font color="red">异常({$v.fc})</font><br/>
          {if condition="$v.fc==0 AND $v.AUserID>0"}
          <button data-bill="{$v.MerBillNo}">补发佣金</button>
          {/if}
        {/if}
        </td>
      </tr>
      {/volist}
{/empty}
    </table>
  </div>
  <!--/列表-->

  <!--内容底部-->
  <div class="page-footer"><div class="btn-wrap">{$list->render()}</div></div>
  <!--/内容底部-->

</form>
</body>
{/block}